import Cookies from 'js-cookie'

const TokenKey: string = 'Admin-Token'

export function getToken(): string | undefined {
  return Cookies.get(TokenKey)
}

export function setToken(token: string): void {
  Cookies.set(TokenKey, token, { expires: new Date(new Date().getTime() + 1 * 60 * 60 * 1000) })
}

export function removeToken(): void {
  Cookies.remove(TokenKey)
}
